package com.fesine.learn.design.pattern.creational.prototype.clone;

import java.util.Date;

/**
 * @description: 类描述
 * @author: fesine
 * @createTime:2019/4/21
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/4/21
 */
public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        Date birthday = new Date(0L);
        Pig pig1 = new Pig("pig1", birthday);
        Pig pig2 = (Pig) pig1.clone();
        System.out.println(pig1);
        System.out.println(pig2);

        pig1.getBirthday().setTime(66666666666L);
        System.out.println(pig1);
        System.out.println(pig2);
    }
}
